package com.woniuxy.hospital.controller;


import com.woniuxy.hospital.entity.HplTitle;
import com.woniuxy.hospital.hplutils.ResponseEntity;
import com.woniuxy.hospital.hplutils.ResponseState;
import com.woniuxy.hospital.service.IHplTitleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  职称控制器
 * </p>
 *
 * @author jobob
 * @since 2021-08-12
 */
@CrossOrigin
@RestController
@RequestMapping("/hpl-title")
public class HplTitleController {

    @Autowired
    private IHplTitleService iHplTitleService;

    @GetMapping("getAll")
    public ResponseEntity<List<HplTitle>> getAll(){
      List<HplTitle> titles =  iHplTitleService.list();
      ResponseEntity<List<HplTitle>> responseEntity = new ResponseEntity<>(ResponseState.SUCCESS,"ok");
      responseEntity.setData(titles);
      return responseEntity;
    }
}

